import Cookie from 'js-cookie';

const key = 'authorization';
// 设置登陆态
export function setCookie(value: string){
    // 设置一天后过期
    Cookie.set(key, value, {expires: 1});
    // 设置12个小时后过期
    // let expires = new Date(+new Date() + 12*60*60*1000);
    // Cookie.set(key, value, {expires});
}

// 清除登陆态
export function removeCookie(){
    Cookie.remove(key);
}

// 获取登陆态
export function getCookie(){
    return Cookie.get(key);
}